package com.green.service.common;

import org.springframework.web.context.ContextLoader;

/**
 * 
 * @author xsq
 * 
 */
public class SpringUtil {
	/**
	 * 得到spirng容器中的对象
	 * @param <T>
	 * @param key
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public static <T> T getBean(String key) {
			return (T) ContextLoader.getCurrentWebApplicationContext().getBean(key);
	}
}
